<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Title</title>
    <link rel="stylesheet" href="./style/index.css">
</head>
<body>
<div id="root"></div>
</body>
<script>
    // touchstart,touchend,touchmove,touchcancel在PC端不起作用。
    const root = document.querySelector("#root");
    // 按下
    root.ontouchstart = function(){
        this.style.background = "green";
        console.log("ontouchstart");
    }
    // 移动
    root.ontouchmove = function(){
        this.style.background = "red";
        console.log("ontouchmove");
    }
    // 抬起
    root.ontouchend = function(){
        this.style.background = null;
        console.log("ontouchend");
    }
    // 取消
    root.ontouchcancel = function(){
        this.style.background = null;
        console.log("ontouchcancel");
    }
    setTimeout(()=>{
        alert("哈哈！");
    },3000);





    // 设计稿 75
    function adapter(){
        document.documentElement.style.fontSize = document.documentElement.clientWidth/10+"px";
    }
    adapter();
    window.onresize = adapter;
</script>
</html>